﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Se.Common
{
    /// <summary>
    /// 结果
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ResultInfo<T>
    {
        /// <summary>
        /// 实例化Result
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="obj"></param>
        /// <param name="success"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public static ResultInfo<T> SetResult<T>(T obj, bool success = true, string message = "")
        {
            var result = new ResultInfo<T>() { IsSuccess = success, Message = message, Obj = obj };
            return result;
        }

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuccess;

        /// <summary>
        /// 消息
        /// </summary>
        public string Message;

        public T Obj;
    }


    /// <summary>
    /// 结果
    /// </summary>
    public class ResultInfo
    {
        /// <summary>
        /// 实例化Result
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="obj"></param>
        /// <param name="success"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public static ResultInfo SetResult(bool success = true, string message = "")
        {
            var result = new ResultInfo() { IsSuccess = success, Message = message };
            return result;
        }

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuccess;

        /// <summary>
        /// 消息
        /// </summary>
        public string Message;

    }
}
